<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<tpl> $NCharset </tpl>" />
<link href="<tpl> $template_dir </tpl>/member/css/layout.css" rel="stylesheet" type="text/css" />
<tpl>include file ='../head.config.html'</tpl>
<tpl>include file ='../../../js/validate/member_shoplink.manage.html'</tpl>
</head><body><tpl>include file ='../header.html'</tpl>
<div id="container761">

  <div class="own_member_main"> 
 <tpl>include file ='own_shop.menu.html'</tpl>
  <div class="member_right"  style="padding-bottom:10px">
  
   	<div class="new_main_left">
		<div class="new_main_left1">
	
	 <h1 class="new_text"><tpl> $langShopMapLocality </tpl></h1>
		<i></i>
	</div>	<b></b> </div>
		<div id="own_main_rightop"></div>
	<div style=" padding-left:80px">
	</div>
    <form name="form1" action="own_shopmap.php?action=save" method="post" style="width:580px; float:left;">
    <div id="placePath"></div>
		<div id="placeChildren"></div>
<div id="myMap" style="position:relative; align:center; width:580px; height:300px; "></div>
<div align="center">
<input name="shopid" type="hidden" value="<tpl>$shopid</tpl>"/>
<input name="userid" type="hidden" value="<tpl>$userid</tpl>"/>
<input name="weizhiX" id="weizhiX" type="hidden" />
<input name="weizhiY" id="weizhiY" type="hidden" />
<input name="weizhiZ" id="weizhiZ" type="hidden" />
<input name="weizhiC" id="weizhiC" type="hidden" />
  <br /><input name="button" type="submit" value="<tpl> $langCsave </tpl>" class="new_anniu" />
</div>
<script language="javascript" src=" http://api.51ditu.com/js/maps.js "></script>
<script language="javascript">
var maps = new LTMaps( "myMap" );

var control = new LTStandMapControl();
maps.addControl( control );

var control = new LTMarkControl();
control.setPointImage("<tpl> $template_dir </tpl>/store/images/a.gif");
maps.addControl( control );

var icon = new LTIcon();
icon.setImageUrl('<tpl> $template_dir </tpl>/store/images/centerPoi.gif');

function getPoi(){
	var poi = control.getMarkControlPoint();
	document.getElementById("weizhiX").value = poi.getLatitude();
	document.getElementById("weizhiY").value = poi.getLongitude();
	document.getElementById("weizhiZ").value = maps.getCurrentZoom();
}
LTEvent.addListener( control , "mouseup" , getPoi );

placeList=LTPlaceList.getDefault();
<tpl> if $city neq "" </tpl>
changeMap("<tpl> $city </tpl>");
maps.cityNameAndZoom( "<tpl> $city </tpl>" , <tpl> $positionZ </tpl> );
//引导地图现在位置
maps.centerAndZoom (       new LTPoint(   <tpl> $positionY </tpl> , <tpl> $positionX </tpl>  ) , <tpl> $positionZ </tpl> );
<tpl> else </tpl>
changeMap("tianjin");
maps.cityNameAndZoom( "tianjin" , 2 );
<tpl> /if </tpl>
function changeMap(name)
{
	var place=placeList.searchPlace(name,1)[0];
	//获取该地名的坐标
	var point=place.getPoint();
	if(point)
	{//有些地名可能没有坐标信息
		maps.centerAndZoom(point,5);
	}
	//创建显示该地名路径的HTML
	var pathHtml=place.getName();
	var p=place.getParent();
	while(p)
	{
		pathHtml="<a href='javascript:changeMap(\""+p.getName()+"\")'>"+p.getName()+"</a>"+"->"+pathHtml;
		p=p.getParent();
	}
	document.getElementById("placePath").innerHTML=pathHtml;

	//创建显示下一级地名的HTML
	var childrenHtml="";
	var children=place.getChildren();
	for(var i=0;i<children.length;i++)
	{
		childrenHtml+="<a href='javascript:changeMap(\""+children[i].getName()+"\")'>"+children[i].getName()+"</a>&nbsp;";
	}
	document.getElementById("placeChildren").innerHTML=childrenHtml;

	document.getElementById("weizhiC").value = place.getPinyin();
}



<tpl> if $positionY != '0' && $positionX !='0' </tpl>
var marker1 = new LTMarker( new LTPoint(   <tpl> $positionY </tpl> ,  <tpl> $positionX </tpl>  ) , icon );
var text = new LTMapText( marker1 );
text.setLabel( "<tpl> $shopname </tpl>" );
text.setBackgroundColor( "#f2f2f2" );
maps.addOverLay( text );
maps.addOverLay( marker1 );
<tpl> /if </tpl>
</script>
</form>

</div>
  <tpl> include file ='../../../html/footer.html' </tpl>
  <div style="clear:both"></div>
   </div>
   </div>
</body>
</html>
